﻿using System;
using System.Windows.Browser;

namespace jLight.Extensions
{
    public static class jQueryExtensionCss
    {

        /// <summary>
        ///  Adds the specified class(es) to each of the set of matched elements.
        /// </summary>
        public static jQueryObject AddClass(this jQueryObject value, string className)
        {
            return value.Invoke("addClass", className);
        }
        /// <summary>
        ///  Adds the specified class(es) to each of the set of matched elements.
        /// </summary>
        public static jQueryObject AddClass(this jQueryObject value, ScriptObject function)
        {
            return value.Invoke("addClass", function);
        }
        /// <summary>
        ///  Adds the specified class(es) to each of the set of matched elements.
        /// </summary>
        public static jQueryObject AddClass(this jQueryObject value, Func<object, object> function)
        {
            return value.Invoke("addClass", jQueryFunction.CreateCallback1(function));
        }
        /// <summary>
        ///  Adds the specified class(es) to each of the set of matched elements.
        /// </summary>
        public static jQueryObject AddClass(this jQueryObject value, Func<jQueryObject,int,string,string> function)
        {
            ;
            return value.Invoke("addClass", jQueryFunction.CreateCallbackjQueryObject(function));
        }
        /// <summary>
        ///   Remove one or all classes from each element in the set of matched elements.
        /// </summary>
        public static jQueryObject RemoveClass(this jQueryObject value)
        {
            return value.Invoke("removeClass");
        }
        /// <summary>
        ///   Remove one or all classes from each element in the set of matched elements.
        /// </summary>
        public static jQueryObject RemoveClass(this jQueryObject value, string className)
        {
            return value.Invoke("removeClass", className);
        }
        /// <summary>
        ///   Remove one or all classes from each element in the set of matched elements.
        /// </summary>
        public static jQueryObject RemoveClass(this jQueryObject value, ScriptObject function)
        {
            return value.Invoke("removeClass", function);
        }

        /// <summary>
        ///   Remove one or all classes from each element in the set of matched elements.
        /// </summary>
        public static jQueryObject RemoveClass(this jQueryObject value, Func<object, object> function)
        {
            return value.Invoke("removeClass", jQueryFunction.CreateCallback1(function));
        }

        public static bool HasClass(this jQueryObject value, string property)
        {
            return value.Invoke<bool>("hasClass", property);
        }


        /// <summary>
        /// Add or remove a class from each element in the set of matched elements, depending on 
        /// either the class's presence or the value of the switch argument.
        /// </summary>
        public static jQueryObject ToggleClass(this jQueryObject value, string className)
        {
            return value.Invoke("toggleClass", className);
        }
        /// <summary>
        /// Add or remove a class from each element in the set of matched elements, depending on 
        /// either the class's presence or the value of the switch argument.
        /// </summary>
        public static jQueryObject ToggleClass(this jQueryObject value, string className, bool classSwitch)
        {
            return value.Invoke("toggleClass", className, classSwitch);
        }
        /// <summary>
        /// Add or remove a class from each element in the set of matched elements, depending on 
        /// either the class's presence or the value of the switch argument.
        /// </summary>
        public static jQueryObject ToggleClass(this jQueryObject value, Func<object, object> function)
        {
            return value.Invoke("toggleClass", function);
        }
        /// <summary>
        /// Add or remove a class from each element in the set of matched elements, depending on 
        /// either the class's presence or the value of the switch argument.
        /// </summary>
        public static jQueryObject ToggleClass(this jQueryObject value, Func<object, object> function, bool classSwitch)
        {
            return value.Invoke("toggleClass", function, classSwitch);
        }




        public static string Css(this jQueryObject value, string property)
        {
            return value.Invoke<string>("css", property);
        }

        public static jQueryObject Css(this jQueryObject value, string propertyName, string propertyValue)
        {
            return value.Invoke("css", propertyName, propertyValue);
        }

        public static jQueryObject Css(this jQueryObject value, jQueryObjectCss css)
        {
            return value.Invoke("css", (ScriptObject)css);
        }


        public static jQueryObject Height(this jQueryObject value, string height)
        {
            return value.Invoke("height", height);
        }
        public static jQueryObject Height(this jQueryObject value, int height)
        {
            return value.Invoke("height", height.ToString());
        }
        public static int Height(this jQueryObject value)
        {
            return value.Invoke<int>("height");
        }

        public static int InnerHeight(this jQueryObject value)
        {
            return value.Invoke<int>("innerHeight");
        }

        public static int InnerWidth(this jQueryObject value)
        {
            return value.Invoke<int>("innerWidth");
        }

        public static jQueryCoordinate Offset(this jQueryObject value)
        {
            return value.Invoke<ScriptObject>("offset");
        }
        public static jQueryObject Offset(this jQueryObject value, jQueryObjectBase parameter)
        {
            return value.Invoke<ScriptObject>("offset", parameter.ScriptObject);
        }
        public static jQueryObject Offset(this jQueryObject value, object parameter)
        {
            return value.Offset(jQueryObjectBase.FromObject(parameter));
        }

        public static int OuterHeight(this jQueryObject value)
        {
            return value.Invoke<int>("outerHeight");
        }
        public static int OuterHeight(this jQueryObject value, bool includeMargin)
        {
            return value.Invoke<int>("outerHeight", includeMargin.ToString());
        }

        public static int OuterWidth(this jQueryObject value)
        {
            return value.Invoke<int>("outerWidth");
        }
        public static int OuterWidth(this jQueryObject value, bool includeMargin)
        {
            return value.Invoke<int>("outerWidth", includeMargin.ToString());
        }

        public static jQueryCoordinate Position(this jQueryObject value)
        {
            return value.Invoke<ScriptObject>("position");
        }

        public static int ScrollLeft(this jQueryObject value)
        {
            return value.Invoke<int>("scrollLeft");
        }
        public static jQueryObject ScrollLeft(this jQueryObject value, int scrollValue)
        {
            return value.Invoke<ScriptObject>("scrollLeft", scrollValue);
        }
        public static int ScrollTop(this jQueryObject value)
        {
            return value.Invoke<int>("scrollTop");
        }
        public static jQueryObject ScrollTop(this jQueryObject value, int scrollValue)
        {
            return value.Invoke<ScriptObject>("scrollTop", scrollValue);
        }
    }
}